<?php
	require('config.CSV.php');
	require('../class.CSVReader.php');
	require('../class.CSVWriter.php');
	
	$csvFile = 'new.csv';
	
	$obj = new CSVReader($csvFile, $newGuarantee, false, false);
	$arr = $obj->getArray();
	
	var_dump($arr);
	
	echo '<br/>';
	
	$csvFile = 'new2.csv';
	
	$arrHeader = array(
		'total_baris',
		'total_plafond'
	);
	
	$obj = new CSVReader($csvFile, $newGuarantee, $arrHeader, false);
	$arr = $obj->getArray();
	
	var_dump($arr);
	
	echo '<br/>';	
	
	$csvFile = 'ext.csv';
	
	$obj = new CSVReader($csvFile, $contGuarantee, false, false);
	$arr = $obj->getArray();
	
	var_dump($arr);	
	
	echo '<br/>';
	
	$csvFile = 'ext2.csv';
	
	$arrHeader = array(
		'total_baris',
		'total_plafond'
	);
		
	$obj = new CSVReader($csvFile, $contGuarantee, $arrHeader, false);
	$arr = $obj->getArray();
	
	var_dump($arr);	
	
	echo '<br/>';
		
	$csvFile = 'output.csv';
	
	$arrInput = array(
		array(
			'090809888',
			'KUR 2011 0987',
			'19/09/2011',
			''
		),
		array(
			'090807060',
			'KUR 2011 0978',
			'20/09/2011',
			'01'		
		)
	);
	
	$obj = new CSVWriter($csvFile);
	$obj->setData($arrInput);
	$obj->saveData();
	
	$csvFile = 'output2.csv';
	
	$arrHeader = array(
		2,
		15000000.00
	);
	
	$arrInput = array(
		array(
			'090809888',
			'KUR 2011 0987',
			'19/09/2011',
			''
		),
		array(
			'090807060',
			'KUR 2011 0978',
			'20/09/2011',
			'01'		
		)
	);
	
	$obj = new CSVWriter($csvFile);
	$obj->setData($arrInput, $arrHeader);
	$obj->saveData();
		
	// End of file.